import com.friend.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import java.util.HashMap;

public class Example {

    @Autowired
    public Config config;

    public static void main(String[] args) {
        // 共享开放平台
//        String appKey = "4xxxxxxxx0";
//        String appSecret = "bdcxxxxxxxxxxxxxxxxxxxxb6";
//        String apiName = "dhcc.tbk.auth.token.list";
//        String apiUrl = "https://openapi.huatuitui.com";

        // 独立开放平台
//        appKey = "cdb9ad";
//        appSecret = "13018cdc3bc9e5036a26af5d662fdd0d";
//        apiName = "dhcc.oauth.user.list";
//        apiUrl = "https://app.openapi.dhcc.wang";
//        appKey = "af3bd5";
//        appSecret = "a1fcf886f02c1635f0d88f4e7af32115";
        Example example = new Example();
        example.config=ApplicationContext

        String apiName = "dhcc.oauth.user.list";
//        apiUrl = "https://app.openapi.dhcc.wang";
        System.out.println("appKey"+example.config.getAppKey());
        SDKClient client = SDKClient.getInstance(example.config.getAppKey(), example.config.getAppSecret(), example.config.getApiUrl());
        HashMap<String, Object> params = new HashMap<>();
        //参数传递
//        params.put("keyword", "~女装 *机🍑");
        String response = client.executeApi(apiName, params);
        System.out.println(response);

        System.out.println(response);


    }
}
